<!DOCTYPE html>਍㰀䠀吀䴀䰀㸀ഀ
<HEAD>਍ऀ㰀吀䤀吀䰀䔀㸀 娀吀刀䔀䔀 䐀䔀䴀伀 ⴀ 最攀琀一漀搀攀䈀礀倀愀爀愀洀 ⼀ 最攀琀一漀搀攀猀䈀礀倀愀爀愀洀 ⼀ 最攀琀一漀搀攀猀䈀礀倀愀爀愀洀䘀甀稀稀礀㰀⼀吀䤀吀䰀䔀㸀ഀ
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">਍ऀ㰀氀椀渀欀 爀攀氀㴀∀猀琀礀氀攀猀栀攀攀琀∀ 栀爀攀昀㴀∀⸀⸀⼀⸀⸀⼀⸀⸀⼀挀猀猀⼀搀攀洀漀⸀挀猀猀∀ 琀礀瀀攀㴀∀琀攀砀琀⼀挀猀猀∀㸀ഀ
	<link rel="stylesheet" href="../../../css/zTreeStyle/zTreeStyle.css" type="text/css">਍ऀ㰀猀挀爀椀瀀琀 琀礀瀀攀㴀∀琀攀砀琀⼀樀愀瘀愀猀挀爀椀瀀琀∀ 猀爀挀㴀∀⸀⸀⼀⸀⸀⼀⸀⸀⼀樀猀⼀樀焀甀攀爀礀ⴀ㄀⸀㐀⸀㐀⸀洀椀渀⸀樀猀∀㸀㰀⼀猀挀爀椀瀀琀㸀ഀ
	<script type="text/javascript" src="../../../js/jquery.ztree.core-3.5.js"></script>਍ऀ㰀℀ⴀⴀ  㰀猀挀爀椀瀀琀 琀礀瀀攀㴀∀琀攀砀琀⼀樀愀瘀愀猀挀爀椀瀀琀∀ 猀爀挀㴀∀⸀⸀⼀⸀⸀⼀⸀⸀⼀樀猀⼀樀焀甀攀爀礀⸀稀琀爀攀攀⸀攀砀挀栀攀挀欀ⴀ㌀⸀㔀⸀樀猀∀㸀㰀⼀猀挀爀椀瀀琀㸀ഀ
	  <script type="text/javascript" src="../../../js/jquery.ztree.exedit-3.5.js"></script>-->਍ऀ㰀匀䌀刀䤀倀吀 琀礀瀀攀㴀∀琀攀砀琀⼀樀愀瘀愀猀挀爀椀瀀琀∀㸀ഀ
		<!--਍ऀऀ瘀愀爀 猀攀琀琀椀渀最 㴀 笀ഀ
			data: {਍ऀऀऀऀ欀攀礀㨀 笀ഀ
					title: "t"਍ऀऀऀऀ紀Ⰰഀ
				simpleData: {਍ऀऀऀऀऀ攀渀愀戀氀攀㨀 琀爀甀攀ഀ
				}				਍ऀऀऀ紀Ⰰഀ
			view: {਍ऀऀऀऀ昀漀渀琀䌀猀猀㨀 最攀琀䘀漀渀琀䌀猀猀ഀ
			}਍ऀऀ紀㬀ഀ
਍ऀऀ瘀愀爀 稀一漀搀攀猀 㴀嬀ഀ
			{ id:1, pId:0, name:"节点搜索演示 1", t:"id=1", open:true},਍ऀऀऀ笀 椀搀㨀㄀㄀Ⰰ 瀀䤀搀㨀㄀Ⰰ 渀愀洀攀㨀∀猀⹑垕⽎൦吊字", t:"id=11"},਍ऀऀऀ笀 椀搀㨀㄀㈀Ⰰ 瀀䤀搀㨀㄀Ⰰ 渀愀洀攀㨀∀猀⹑垕⽎汦攀瘀攀氀∀Ⰰ 琀㨀∀椀搀㴀㄀㈀∀紀Ⰰഀ
			{ id:13, pId:1, name:"关键字可以是id", t:"id=13"},਍ऀऀऀ笀 椀搀㨀㄀㐀Ⰰ 瀀䤀搀㨀㄀Ⰰ 渀愀洀攀㨀∀猀⹑垕⽎Ѧ쵔幹❜≠Ⰰ 琀㨀∀椀搀㴀㄀㐀∀紀Ⰰഀ
			{ id:2, pId:0, name:"节点搜索演示 2", t:"id=2", open:true},਍ऀऀऀ笀 椀搀㨀㈀㄀Ⰰ 瀀䤀搀㨀㈀Ⰰ 渀愀洀攀㨀∀᱓≤}⩎艎릂≰Ⰰ 琀㨀∀椀搀㴀㈀㄀∀紀Ⰰഀ
			{ id:22, pId:2, name:"可以搜索节点集合", t:"id=22"},਍ऀऀऀ笀 椀搀㨀㈀㌀Ⰰ 瀀䤀搀㨀㈀Ⰰ 渀愀洀攀㨀∀ᰀᅤ❢≔Ⰰ 琀㨀∀椀搀㴀㈀㌀∀紀Ⰰഀ
			{ id:3, pId:0, name:"节点搜索演示 3", t:"id=3", open:true },਍ऀऀऀ笀 椀搀㨀㌀㄀Ⰰ 瀀䤀搀㨀㌀Ⰰ 渀愀洀攀㨀∀ᄀ葢⁶椀搀 ⼀㩦 ㌀㄀∀Ⰰ 琀㨀∀椀搀㴀㌀㄀∀紀Ⰰഀ
			{ id:32, pId:31, name:"我的 id 是: 32", t:"id=32"},਍ऀऀऀ笀 椀搀㨀㌀㌀Ⰰ 瀀䤀搀㨀㌀㈀Ⰰ 渀愀洀攀㨀∀ᄀ葢⁶椀搀 ⼀㩦 ㌀㌀∀Ⰰ 琀㨀∀椀搀㴀㌀㌀∀紀ഀ
		];਍ഀ
		function focusKey(e) {਍ऀऀऀ椀昀 ⠀欀攀礀⸀栀愀猀䌀氀愀猀猀⠀∀攀洀瀀琀礀∀⤀⤀ 笀ഀ
				key.removeClass("empty");਍ऀऀऀ紀ഀ
		}਍ऀऀ昀甀渀挀琀椀漀渀 戀氀甀爀䬀攀礀⠀攀⤀ 笀ഀ
			if (key.get(0).value === "") {਍ऀऀऀऀ欀攀礀⸀愀搀搀䌀氀愀猀猀⠀∀攀洀瀀琀礀∀⤀㬀ഀ
			}਍ऀऀ紀ഀ
		var lastValue = "", nodeList = [], fontCss = {};਍ऀऀ昀甀渀挀琀椀漀渀 挀氀椀挀欀刀愀搀椀漀⠀攀⤀ 笀ഀ
			lastValue = "";਍ऀऀऀ猀攀愀爀挀栀一漀搀攀⠀攀⤀㬀ഀ
		}਍ऀऀ昀甀渀挀琀椀漀渀 猀攀愀爀挀栀一漀搀攀⠀攀⤀ 笀ഀ
			var zTree = $.fn.zTree.getZTreeObj("treeDemo");਍ऀऀऀ椀昀 ⠀℀␀⠀∀⌀最攀琀一漀搀攀猀䈀礀䘀椀氀琀攀爀∀⤀⸀愀琀琀爀⠀∀挀栀攀挀欀攀搀∀⤀⤀ 笀ഀ
				var value = $.trim(key.get(0).value);਍ऀऀऀऀ瘀愀爀 欀攀礀吀礀瀀攀 㴀 ∀∀㬀ഀ
				if ($("#name").attr("checked")) {਍ऀऀऀऀऀ欀攀礀吀礀瀀攀 㴀 ∀渀愀洀攀∀㬀ഀ
				} else if ($("#level").attr("checked")) {਍ऀऀऀऀऀ欀攀礀吀礀瀀攀 㴀 ∀氀攀瘀攀氀∀㬀ഀ
					value = parseInt(value);਍ऀऀऀऀ紀 攀氀猀攀 椀昀 ⠀␀⠀∀⌀椀搀∀⤀⸀愀琀琀爀⠀∀挀栀攀挀欀攀搀∀⤀⤀ 笀ഀ
					keyType = "id";਍ऀऀऀऀऀ瘀愀氀甀攀 㴀 瀀愀爀猀攀䤀渀琀⠀瘀愀氀甀攀⤀㬀ഀ
				}਍ऀऀऀऀ椀昀 ⠀欀攀礀⸀栀愀猀䌀氀愀猀猀⠀∀攀洀瀀琀礀∀⤀⤀ 笀ഀ
					value = "";਍ऀऀऀऀ紀ഀ
				if (lastValue === value) return;਍ऀऀऀऀ氀愀猀琀嘀愀氀甀攀 㴀 瘀愀氀甀攀㬀ഀ
				if (value === "") return;਍ऀऀऀऀ甀瀀搀愀琀攀一漀搀攀猀⠀昀愀氀猀攀⤀㬀ഀ
਍ऀऀऀऀ椀昀 ⠀␀⠀∀⌀最攀琀一漀搀攀䈀礀倀愀爀愀洀∀⤀⸀愀琀琀爀⠀∀挀栀攀挀欀攀搀∀⤀⤀ 笀ഀ
					var node = zTree.getNodeByParam(keyType, value);਍ऀऀऀऀऀ椀昀 ⠀渀漀搀攀 㴀㴀㴀 渀甀氀氀⤀ 笀ഀ
						nodeList = [];਍ऀऀऀऀऀ紀 攀氀猀攀 笀ഀ
						nodeList = [node];਍ऀऀऀऀऀ紀ഀ
				} else if ($("#getNodesByParam").attr("checked")) {਍ऀऀऀऀऀ渀漀搀攀䰀椀猀琀 㴀 稀吀爀攀攀⸀最攀琀一漀搀攀猀䈀礀倀愀爀愀洀⠀欀攀礀吀礀瀀攀Ⰰ 瘀愀氀甀攀⤀㬀ഀ
				} else if ($("#getNodesByParamFuzzy").attr("checked")) {਍ऀऀऀऀऀ渀漀搀攀䰀椀猀琀 㴀 稀吀爀攀攀⸀最攀琀一漀搀攀猀䈀礀倀愀爀愀洀䘀甀稀稀礀⠀欀攀礀吀礀瀀攀Ⰰ 瘀愀氀甀攀⤀㬀ഀ
				}਍ऀऀऀ紀 攀氀猀攀 笀ഀ
				updateNodes(false);਍ऀऀऀऀ渀漀搀攀䰀椀猀琀 㴀 稀吀爀攀攀⸀最攀琀一漀搀攀猀䈀礀䘀椀氀琀攀爀⠀昀椀氀琀攀爀⤀㬀ഀ
			}਍ऀऀऀ甀瀀搀愀琀攀一漀搀攀猀⠀琀爀甀攀⤀㬀ഀ
਍ऀऀ紀ഀ
		function updateNodes(highlight) {਍ऀऀऀ瘀愀爀 稀吀爀攀攀 㴀 ␀⸀昀渀⸀稀吀爀攀攀⸀最攀琀娀吀爀攀攀伀戀樀⠀∀琀爀攀攀䐀攀洀漀∀⤀㬀ഀ
			for( var i=0, l=nodeList.length; i<l; i++) {਍ऀऀऀऀ渀漀搀攀䰀椀猀琀嬀椀崀⸀栀椀最栀氀椀最栀琀 㴀 栀椀最栀氀椀最栀琀㬀ഀ
				zTree.updateNode(nodeList[i]);਍ऀऀऀ紀ഀ
		}਍ऀऀ昀甀渀挀琀椀漀渀 最攀琀䘀漀渀琀䌀猀猀⠀琀爀攀攀䤀搀Ⰰ 琀爀攀攀一漀搀攀⤀ 笀ഀ
			return (!!treeNode.highlight) ? {color:"#A60000", "font-weight":"bold"} : {color:"#333", "font-weight":"normal"};਍ऀऀ紀ഀ
		function filter(node) {਍ऀऀऀ爀攀琀甀爀渀 ℀渀漀搀攀⸀椀猀倀愀爀攀渀琀 ☀☀ 渀漀搀攀⸀椀猀䘀椀爀猀琀一漀搀攀㬀ഀ
		}਍ഀ
		var key;਍ऀऀ␀⠀搀漀挀甀洀攀渀琀⤀⸀爀攀愀搀礀⠀昀甀渀挀琀椀漀渀⠀⤀笀ഀ
			$.fn.zTree.init($("#treeDemo"), setting, zNodes);਍ऀऀऀ欀攀礀 㴀 ␀⠀∀⌀欀攀礀∀⤀㬀ഀ
			key.bind("focus", focusKey)਍ऀऀऀ⸀戀椀渀搀⠀∀戀氀甀爀∀Ⰰ 戀氀甀爀䬀攀礀⤀ഀ
			.bind("propertychange", searchNode)਍ऀऀऀ⸀戀椀渀搀⠀∀椀渀瀀甀琀∀Ⰰ 猀攀愀爀挀栀一漀搀攀⤀㬀ഀ
			$("#name").bind("change", clickRadio);਍ऀऀऀ␀⠀∀⌀氀攀瘀攀氀∀⤀⸀戀椀渀搀⠀∀挀栀愀渀最攀∀Ⰰ 挀氀椀挀欀刀愀搀椀漀⤀㬀ഀ
			$("#id").bind("change", clickRadio);਍ऀऀऀ␀⠀∀⌀最攀琀一漀搀攀䈀礀倀愀爀愀洀∀⤀⸀戀椀渀搀⠀∀挀栀愀渀最攀∀Ⰰ 挀氀椀挀欀刀愀搀椀漀⤀㬀ഀ
			$("#getNodesByParam").bind("change", clickRadio);਍ऀऀऀ␀⠀∀⌀最攀琀一漀搀攀猀䈀礀倀愀爀愀洀䘀甀稀稀礀∀⤀⸀戀椀渀搀⠀∀挀栀愀渀最攀∀Ⰰ 挀氀椀挀欀刀愀搀椀漀⤀㬀ഀ
			$("#getNodesByFilter").bind("change", clickRadio);਍ऀऀ紀⤀㬀ഀ
		//-->਍ऀ㰀⼀匀䌀刀䤀倀吀㸀ഀ
</HEAD>਍ഀ
<BODY>਍㰀栀㄀㸀㤀湨쉣灓繧艢릂㱰⼀栀㄀㸀ഀ
<h6>[ 文件路径: core/searchNodes.html ]</h6>਍㰀搀椀瘀 挀氀愀猀猀㴀∀挀漀渀琀攀渀琀开眀爀愀瀀∀㸀ഀ
	<div class="zTreeDemoBackground left">਍ऀऀ㰀甀氀 椀搀㴀∀琀爀攀攀䐀攀洀漀∀ 挀氀愀猀猀㴀∀稀琀爀攀攀∀㸀㰀⼀甀氀㸀ഀ
	</div>਍ऀ㰀搀椀瘀 挀氀愀猀猀㴀∀爀椀最栀琀∀㸀ഀ
		<ul class="info">਍ऀऀऀ㰀氀椀 挀氀愀猀猀㴀∀琀椀琀氀攀∀㸀㰀栀㈀㸀㄀Ā朰攀琀一漀搀攀䈀礀倀愀爀愀洀 ⼀ 最攀琀一漀搀攀猀䈀礀倀愀爀愀洀 ⼀ 最攀琀一漀搀攀猀䈀礀倀愀爀愀洀䘀甀稀稀礀 뤀핥쵬層຋㱦⼀栀㈀㸀ഀ
				<ul class="list">਍ऀऀऀऀ㰀氀椀 挀氀愀猀猀㴀∀栀椀最栀氀椀最栀琀开爀攀搀∀㸀缀⡏⁵稀吀爀攀攀伀戀樀⸀最攀琀一漀搀攀䈀礀倀愀爀愀洀 ⼀ 最攀琀一漀搀攀猀䈀礀倀愀爀愀洀 ⼀ 最攀琀一漀搀攀猀䈀礀倀愀爀愀洀䘀甀稀稀礀 ⼀ 最攀琀一漀搀攀䈀礀吀䤀搀 뤀핥౬욋슋셓₉䄀倀䤀 蜀捥⵨葎獶蕑륑㱛⼀氀椀㸀ഀ
				<li><p>搜索试试看：<br/>਍ऀऀऀऀऀऀ帀❜㱠⡐ 瘀愀氀甀攀 ⤀ᨀ㳿椀渀瀀甀琀 琀礀瀀攀㴀∀琀攀砀琀∀ 椀搀㴀∀欀攀礀∀ 瘀愀氀甀攀㴀∀∀ 挀氀愀猀猀㴀∀攀洀瀀琀礀∀ ⼀㸀㰀戀爀⼀㸀ഀ
						属性( key )：<input type="radio" id="name" name="keyType" class="radio first" checked /><span>name (string)</span><br/>਍ऀऀऀऀऀऀ㰀椀渀瀀甀琀 琀礀瀀攀㴀∀爀愀搀椀漀∀ 椀搀㴀∀氀攀瘀攀氀∀ 渀愀洀攀㴀∀欀攀礀吀礀瀀攀∀ 挀氀愀猀猀㴀∀爀愀搀椀漀∀ 猀琀礀氀攀㴀∀洀愀爀最椀渀ⴀ氀攀昀琀㨀㘀㠀瀀砀㬀∀ ⼀㸀㰀猀瀀愀渀㸀氀攀瘀攀氀 ⠀渀甀洀戀攀爀⤀ ⸀⸀⸀ 㤀艨릂⁰氀攀瘀攀氀 㴀 　㰀⼀猀瀀愀渀㸀㰀戀爀⼀㸀ഀ
						<input type="radio" id="id" name="keyType" class="radio" style="margin-left:68px;" /><span>id (number)</span><br/>਍ऀऀऀऀऀऀ뤀핥ᩬ㳿椀渀瀀甀琀 琀礀瀀攀㴀∀爀愀搀椀漀∀ 椀搀㴀∀最攀琀一漀搀攀䈀礀倀愀爀愀洀∀ 渀愀洀攀㴀∀昀甀渀吀礀瀀攀∀ 挀氀愀猀猀㴀∀爀愀搀椀漀 昀椀爀猀琀∀ ⼀㸀㰀猀瀀愀渀㸀最攀琀一漀搀攀䈀礀倀愀爀愀洀㰀⼀猀瀀愀渀㸀㰀戀爀⼀㸀ഀ
						<input type="radio" id="getNodesByParam" name="funType" class="radio" style="margin-left:36px;" /><span>getNodesByParam</span><br/>਍ऀऀऀऀऀऀ㰀椀渀瀀甀琀 琀礀瀀攀㴀∀爀愀搀椀漀∀ 椀搀㴀∀最攀琀一漀搀攀猀䈀礀倀愀爀愀洀䘀甀稀稀礀∀ 渀愀洀攀㴀∀昀甀渀吀礀瀀攀∀ 挀氀愀猀猀㴀∀爀愀搀椀漀∀ 猀琀礀氀攀㴀∀洀愀爀最椀渀ⴀ氀攀昀琀㨀㌀㘀瀀砀㬀∀ 挀栀攀挀欀攀搀 ⼀㸀㰀猀瀀愀渀㸀最攀琀一漀搀攀猀䈀礀倀愀爀愀洀䘀甀稀稀礀 ⠀漀渀氀礀 猀琀爀椀渀最⤀㰀⼀猀瀀愀渀㸀㰀戀爀⼀㸀ഀ
						<input type="radio" id="getNodesByFilter" name="funType" class="radio" style="margin-left:36px;" /><span>getNodesByFilter (参考本页源码中 function filter)</span><br/>਍ऀऀऀऀऀ㰀⼀瀀㸀ഀ
				</li>਍ऀऀऀऀ㰀⼀甀氀㸀ഀ
			</li>਍ऀऀऀ㰀氀椀 挀氀愀猀猀㴀∀琀椀琀氀攀∀㸀㰀栀㈀㸀㈀Ā猰攀琀琀椀渀最 䴀溑潏຋㱦⼀栀㈀㸀ഀ
				<ul class="list">਍ऀऀऀऀ㰀氀椀㸀ഀ上需要对 setting 进行特殊设置</li>਍ऀऀऀऀ㰀⼀甀氀㸀ഀ
			</li>਍ऀऀऀ㰀氀椀 挀氀愀猀猀㴀∀琀椀琀氀攀∀㸀㰀栀㈀㸀㌀Ā琰爀攀攀一漀搀攀 舀릂灰湥຋㱦⼀栀㈀㸀ഀ
				<ul class="list">਍ऀऀऀऀ㰀氀椀 挀氀愀猀猀㴀∀栀椀最栀氀椀最栀琀开爀攀搀∀㸀ཬѡ⩔륎핥罬⡏